#include <iostream>
using namespace std;

struct TreeNode {
    int val;
    TreeNode *left;
    TreeNode *right;
    TreeNode(int x) : val(x), left(NULL), right(NULL) {}
};

bool pro(TreeNode* root,int val)
{
    if(root == nullptr){
        return true;
    }
    if(root->val == val){
        return (pro(root->left,val) && pro(root->right,val));
    }else{
        return false;
    }
}

bool isUnivalTree(TreeNode* root) 
{
    return pro(root,root->val);
}

int main()
{

}